<?php
/**
 * Created by PhpStorm.
 * User: 11509
 * Date: 2021/4/5
 * Time: 2:25
 */

namespace app\admin\model;


use think\Model;

class Banner extends Model
{

    //查询数据库
    public static function getBannerSel()
    {
        $sel=Banner::select();
        return $sel;
    }
    //成功就修改数据库,否则传错误信息
    public static function addBannnerInfo($data)
    {
        try{
            $res=Banner::strict(true)->save($data);
            $msg='添加成功';
        }catch(\Exception $e){
            $res=false;
            $msg=$e->getMessage();
        }
        return [$res,$msg];
    }

}